package com.reverse.engineering.util.core.run.bean;

/**
 * 
 * @author liu
 * @date 2020-08-18
 */
public class XmlTemplates {

    private StringBuilder resultMap = new StringBuilder();
    private StringBuilder columns = new StringBuilder();
    private StringBuilder insertValues = new StringBuilder();
    private StringBuilder insertListValues = new StringBuilder();
    private StringBuilder updateValues = new StringBuilder();
    private StringBuilder updateListValues = new StringBuilder();
    private StringBuilder updatePartialValues = new StringBuilder();
    private StringBuilder updatePartialListValues = new StringBuilder();
    private StringBuilder whereCondition = new StringBuilder();
    private StringBuilder deleteCondition = new StringBuilder();

    public StringBuilder getResultMap() {
        return resultMap;
    }

    public void setResultMap(StringBuilder resultMap) {
        this.resultMap = resultMap;
    }

    public StringBuilder getColumns() {
        return columns;
    }

    public void setColumns(StringBuilder columns) {
        this.columns = columns;
    }

    public StringBuilder getInsertValues() {
        return insertValues;
    }

    public void setInsertValues(StringBuilder insertValues) {
        this.insertValues = insertValues;
    }

    public StringBuilder getInsertListValues() {
        return insertListValues;
    }

    public void setInsertListValues(StringBuilder insertListValues) {
        this.insertListValues = insertListValues;
    }

    public StringBuilder getUpdateValues() {
        return updateValues;
    }

    public void setUpdateValues(StringBuilder updateValues) {
        this.updateValues = updateValues;
    }

    public StringBuilder getUpdateListValues() {
        return updateListValues;
    }

    public void setUpdateListValues(StringBuilder updateListValues) {
        this.updateListValues = updateListValues;
    }

    public StringBuilder getUpdatePartialValues() {
        return updatePartialValues;
    }

    public void setUpdatePartialValues(StringBuilder updatePartialValues) {
        this.updatePartialValues = updatePartialValues;
    }

    public StringBuilder getUpdatePartialListValues() {
        return updatePartialListValues;
    }

    public void setUpdatePartialListValues(StringBuilder updatePartialListValues) {
        this.updatePartialListValues = updatePartialListValues;
    }

    public StringBuilder getWhereCondition() {
        return whereCondition;
    }

    public void setWhereCondition(StringBuilder whereCondition) {
        this.whereCondition = whereCondition;
    }

    public StringBuilder getDeleteCondition() {
        return deleteCondition;
    }

    public void setDeleteCondition(StringBuilder deleteCondition) {
        this.deleteCondition = deleteCondition;
    }

    /**
     * 去除最后两位字符
     */
    public void removeTwoLastChar() {
        resultMap.replace(resultMap.length() - 1, resultMap.length(), "");
        columns.replace(columns.length() - 2, columns.length(), "");
        insertValues.replace(insertValues.length() - 2, insertValues.length(), "");
        insertListValues.replace(insertListValues.length() - 2, insertListValues.length(), "");
        updateValues.replace(updateValues.length() - 2, updateValues.length(), "");
        updateListValues.replace(updateListValues.length() - 2, updateListValues.length(), "");
        updatePartialValues.replace(updatePartialValues.length() - 1, updatePartialValues.length(), "");
        updatePartialListValues.replace(updatePartialListValues.length() - 1, updatePartialListValues.length(), "");
        whereCondition.replace(whereCondition.length() - 1, whereCondition.length(), "");
        deleteCondition.replace(deleteCondition.length() - 1, deleteCondition.length(), "");
    }

}